<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<c:url value="/resources/css/view.css"/>" >
</head>
<body>
 
<h1>Customer</h1>
<form:form modelAttribute="customer" method="POST" action="">
 <form:hidden path="customerId" />
 <form:hidden path="shippingAddressId" />
 <table>
  <tr>
   <td><form:label path="firstName">firstName:</form:label></td>
   <td><form:input path="firstName"/></td>
   <td><form:errors path="firstName" cssClass="error"/></td>
  </tr>
  
  <tr>
   <td><form:label path="lastName">lastName:</form:label></td>
   <td><form:input path="lastName"/></td>
   <td><form:errors path="lastName" cssClass="error"/></td> 
  </tr>
 
  <tr>
   <td><form:label path="gender">gender</form:label></td>
<%--    <td><form:checkbox path="gender"/></td> --%>
  	<td><form:select path="gender" items="${genderMap}" multiple="false" /></td>
  </tr>
  
  <tr>
   <td><form:label path="birthDate">birthDate:</form:label></td>
   <fmt:formatDate value="${customer.birthDate}" var="dateString" pattern="dd-MM-yyyy" />
   <td><form:input path="birthDate" value="${dateString}" /></td>
   <td><form:errors path="birthDate" cssClass="error"/></td> 
  </tr>

<!--   <tr> -->
<%--     <td><form:label path="birthDate">birthDate</form:label></td> --%>
<%--     <td><form:input type="date" path="birthDate"/></td> --%>
<!--   </tr> -->

  
 </table>
  <table>
 <tr>
 	<td width="70"><input type="submit" value="Save" /></td>
	<td><a href="<c:url value="/customer"/>" > back </a></td>
</tr>
</table>
 
</form:form>
</body>
</html>